package main

import (
	"fmt"
	"github.com/labstack/echo"
	// "github.com/labstack/echo/middleware"
	ewa "gitee.com/jinquan711/ewa"
	cb "gitee.com/jinquan711/ewa/example3/cb"
)

func main() {

	ewa.ConfigParser()
	//ewa.ConfigPrint()
	ewa.UseAuth()

	e := echo.New()
	// e.Use(middleware.Logger())

	e.Static("/static", ewa.ExeDir+`/`+ewa.StaticDir)
	l:=fmt.Sprintf("----Echo/> static resource dir '%s'", ewa.ExeDir+`/`+ewa.StaticDir);ewa.Log(l)

	ewa.PageTemplatePool(e, ewa.CfgRendPage.PageTempDir+`/`+"*.html")

	ewa.InnerCfgRouteInit(e)


	ewa.RouteRegistry_CookieTokenPost("/api0", e, cb.Cb_api0)

	// e.Logger.Fatal(e.Start(ewa.EchoPort))
	e.Start(ewa.EchoPort)
}
